package com.lmiot.xyclick.Bind;

import android.app.Activity;
import android.content.Context;
import android.content.Intent;
import android.os.Bundle;
import android.os.Handler;
import android.os.Message;
import android.support.v4.app.Fragment;
import android.text.Editable;
import android.text.Html;
import android.text.TextUtils;
import android.text.TextWatcher;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;
import android.widget.BaseAdapter;
import android.widget.EditText;
import android.widget.ImageView;
import android.widget.LinearLayout;
import android.widget.ListAdapter;
import android.widget.ListView;
import android.widget.TextView;
import com.bumptech.glide.Glide;
import com.google.gson.Gson;
import com.lmiot.xyclick.ActionDetailBean.DetailBean;
import com.lmiot.xyclick.App.MyApp;
import com.lmiot.xyclick.Auto.AutoUtils;
import com.lmiot.xyclick.Bean.AppBean;
import com.lmiot.xyclick.Bean.ItemActionBean;
import com.lmiot.xyclick.Bean.SQL.ActionBean;
import com.lmiot.xyclick.Bean.SQL.AutoBean;
import com.lmiot.xyclick.Bean.SQL.AutoBeanSqlUtil;
import com.lkx.liandianqinew.R;
import com.lmiot.xyclick.Util.ApplicationInfoUtil;
import com.lmiot.xyclick.Util.Constants;
import com.lmiot.xyclick.Util.DataUtil;
import com.lmiot.xyclick.Util.LogUtil;
import com.youyi.yyviewsdklibrary.ArrayGson;
import java.util.ArrayList;
import java.util.List;

public class FloatFragmentDetail extends Fragment implements View.OnClickListener {
    private static String DATAKEY = "STATE";
    private static Context mContext;
    private ActionBean mActionBean;
    Activity mActivity;
    private List<AppBean> mAppList;
    private DetailBean mDetailBean;
    private String mDirect;
    private String mDirectData;
    private Handler mHandler;
    TextView mIdAddBt;
    TextView mIdDetail;
    LinearLayout mIdEmptyLayout;
    ListView mIdListview;
    EditText mIdSearchEdit;
    LinearLayout mIdSearchLayout;
    private Intent mIntent;
    private List<ItemActionBean> mItemActionBeanList;
    private ObjAdapter mObjAdapter;
    private String mSearchName;
    private int mState = 0;
    private Constants.TypeGroup mTypeGroupChose = Constants.TypeGroup.CLICK;

    public FloatFragmentDetail() {
    }

    public FloatFragmentDetail(Context context, String str, int i) {
        mContext = context;
        this.mDirect = str;
        this.mState = i;
        this.mDirectData = DataUtil.getDirectData(context, str);
        LogUtil.d("FloatFragmentDetail", "mDirectData:" + this.mDirect + "：" + this.mDirectData);
        if (!TextUtils.isEmpty(this.mDirectData)) {
            ActionBean actionBean = (ActionBean) new ArrayGson().fromJson(this.mDirectData, ActionBean.class);
            this.mActionBean = actionBean;
            String detail = actionBean.getDetail();
            if (!TextUtils.isEmpty(detail)) {
                this.mDetailBean = (DetailBean) new ArrayGson().fromJson(detail, DetailBean.class);
            }
        }
    }

    @Override // android.support.v4.app.Fragment
    public void onCreate(Bundle bundle) {
        super.onCreate(bundle);
    }

    @Override // android.support.v4.app.Fragment
    public void onAttach(Activity activity) {
        super.onAttach(activity);
        this.mActivity = activity;
    }

    public Activity getMyActivity() {
        return this.mActivity;
    }

    @Override // android.support.v4.app.Fragment
    public View onCreateView(LayoutInflater layoutInflater, ViewGroup viewGroup, Bundle bundle) {
        if (mContext == null) {
            this.mActivity = getMyActivity();
        }
        View inflate = View.inflate(mContext, R.layout.fragment_float_detail, null);
        this.mIdAddBt = (TextView) inflate.findViewById(R.id.id_add_bt);
        this.mIdDetail = (TextView) inflate.findViewById(R.id.id_detail);
        this.mIdEmptyLayout = (LinearLayout) inflate.findViewById(R.id.id_empty_layout);
        this.mIdSearchEdit = (EditText) inflate.findViewById(R.id.id_search_edit);
        this.mIdSearchLayout = (LinearLayout) inflate.findViewById(R.id.id_search_layout);
        this.mIdListview = (ListView) inflate.findViewById(R.id.id_listview);
        this.mIdAddBt.setOnClickListener(this);
        init();
        return inflate;
    }

    @Override // android.support.v4.app.Fragment
    public void onResume() {
        super.onResume();
    }

    public void init() {
        setFind();
        LogUtil.d("FloatFragmentDetail", "mState:" + this.mState);
        int i = this.mState;
        if (i == 0) {
            this.mIdEmptyLayout.setVisibility(View.GONE);
            this.mIdSearchLayout.setVisibility(View.GONE);
            showControl(Constants.TypeGroup.APP);
        } else if (i == 1) {
            this.mIdSearchLayout.setVisibility(View.VISIBLE);
            showUserDefinde(Constants.TypeGroup.APP);
        } else if (i == 2) {
            this.mIdEmptyLayout.setVisibility(View.GONE);
            this.mIdSearchLayout.setVisibility(View.GONE);
            showSetting(Constants.TypeGroup.SYSTEM);
        } else if (i == 3) {
            this.mIdEmptyLayout.setVisibility(View.GONE);
            this.mIdSearchLayout.setVisibility(View.VISIBLE);
            showAPPList(Constants.TypeGroup.APP);
        } else if (i == 4) {
            this.mIdEmptyLayout.setVisibility(View.GONE);
            this.mIdSearchLayout.setVisibility(View.GONE);
            showKuai(Constants.TypeGroup.TOOL);
        }
    }

    private void showAPPList(Constants.TypeGroup typeGroup) {
        try {
            this.mTypeGroupChose = typeGroup;
            this.mItemActionBeanList = new ArrayList();
            this.mAppList = new ArrayList();
            this.mHandler = new Handler() {
                /* class com.lmiot.xyclick.Bind.FloatFragmentDetail.AnonymousClass1 */

                public void handleMessage(Message message) {
                    try {
                        if (message.what == 5253 && FloatFragmentDetail.this.mTypeGroupChose == Constants.TypeGroup.APP) {
                            FloatFragmentDetail.this.mItemActionBeanList.clear();
                            if (FloatFragmentDetail.this.mAppList.size() > 0) {
                                for (AppBean appBean : FloatFragmentDetail.this.mAppList) {
                                    FloatFragmentDetail.this.mItemActionBeanList.add(new ItemActionBean(Constants.TypeGroup.APP, Constants.ACTION_TYPE_OPEN_APP_NEW, appBean.getAppIcon(), 0, appBean.getAppName(), appBean.getPackageName(), false));
                                }
                                FloatFragmentDetail floatFragmentDetail = FloatFragmentDetail.this;
                                FloatFragmentDetail floatFragmentDetail2 = FloatFragmentDetail.this;
                                floatFragmentDetail.mObjAdapter = new ObjAdapter(floatFragmentDetail2.mItemActionBeanList);
                                if (!(FloatFragmentDetail.this.mIdListview == null || FloatFragmentDetail.this.mObjAdapter == null)) {
                                    FloatFragmentDetail.this.mIdListview.setAdapter((ListAdapter) FloatFragmentDetail.this.mObjAdapter);
                                }
                            }
                        }
                    } catch (Exception e) {
                        e.printStackTrace();
                    }
                }
            };
            new Thread() {
                /* class com.lmiot.xyclick.Bind.FloatFragmentDetail.AnonymousClass2 */

                public void run() {
                    FloatFragmentDetail.this.mAppList = ApplicationInfoUtil.getAllApp(MyApp.getContext());
                    LogUtil.d("ChoseActionUtil", "mAppList.size():" + FloatFragmentDetail.this.mAppList.size());
                    FloatFragmentDetail.this.mHandler.sendEmptyMessage(5253);
                }
            }.start();
        } catch (Exception e) {
            e.printStackTrace();
        }
    }

    private void showSetting(Constants.TypeGroup typeGroup) {
        this.mTypeGroupChose = typeGroup;
        ArrayList arrayList = new ArrayList();
        this.mItemActionBeanList = arrayList;
        arrayList.add(getItemByEume(Constants.TypeGroup.Action, Constants.ActionEnum.Action_back));
        this.mItemActionBeanList.add(getItemByEume(Constants.TypeGroup.Action, Constants.ActionEnum.Action_home));
        this.mItemActionBeanList.add(getItemByEume(Constants.TypeGroup.Action, Constants.ActionEnum.Action_shortcut_sys));
        this.mItemActionBeanList.add(getItemByEume(Constants.TypeGroup.Action, Constants.ActionEnum.Action_lock));
        this.mItemActionBeanList.add(getItemByEume(Constants.TypeGroup.Action, Constants.ActionEnum.Action_power));
        this.mItemActionBeanList.add(getItemByEume(Constants.TypeGroup.Action, Constants.ActionEnum.Action_recent));
        this.mItemActionBeanList.add(getItemByEume(Constants.TypeGroup.Action, Constants.ActionEnum.Action_notic));
        this.mItemActionBeanList.add(getItemByEume(Constants.TypeGroup.Action, Constants.ActionEnum.Action_remote_run));
        this.mItemActionBeanList.add(getItemByEume(Constants.TypeGroup.Action, Constants.ActionEnum.Action_remote_stop));
        this.mItemActionBeanList.add(getItemByEume(Constants.TypeGroup.SYSTEM, Constants.ActionEnum.System_wifi_on));
        this.mItemActionBeanList.add(getItemByEume(Constants.TypeGroup.SYSTEM, Constants.ActionEnum.System_wifi_off));
        this.mItemActionBeanList.add(getItemByEume(Constants.TypeGroup.SYSTEM, Constants.ActionEnum.System_blue_on));
        this.mItemActionBeanList.add(getItemByEume(Constants.TypeGroup.SYSTEM, Constants.ActionEnum.System_blue_off));
        this.mItemActionBeanList.add(getItemByEume(Constants.TypeGroup.SYSTEM, Constants.ActionEnum.System_led_on));
        this.mItemActionBeanList.add(getItemByEume(Constants.TypeGroup.SYSTEM, Constants.ActionEnum.System_led_off));
        this.mItemActionBeanList.add(getItemByEume(Constants.TypeGroup.SYSTEM, Constants.ActionEnum.System_notic_open));
        this.mItemActionBeanList.add(getItemByEume(Constants.TypeGroup.SYSTEM, Constants.ActionEnum.System_notic_close));
        this.mItemActionBeanList.add(getItemByEume(Constants.TypeGroup.SYSTEM, Constants.ActionEnum.System_set_volume));
        this.mItemActionBeanList.add(getItemByEume(Constants.TypeGroup.SYSTEM, Constants.ActionEnum.System_set_screen));
        this.mItemActionBeanList.add(getItemByEume(Constants.TypeGroup.SYSTEM, Constants.ActionEnum.System_queit));
        this.mItemActionBeanList.add(getItemByEume(Constants.TypeGroup.SYSTEM, Constants.ActionEnum.System_vibrate));
        this.mItemActionBeanList.add(getItemByEume(Constants.TypeGroup.SYSTEM, Constants.ActionEnum.System_stander));
        this.mItemActionBeanList.add(getItemByEume(Constants.TypeGroup.SYSTEM, Constants.ActionEnum.System_screen_on));
        this.mItemActionBeanList.add(getItemByEume(Constants.TypeGroup.SYSTEM, Constants.ActionEnum.System_goto_setting));
        this.mItemActionBeanList.add(getItemByEume(Constants.TypeGroup.SYSTEM, Constants.ActionEnum.System_goto_tif));
        this.mItemActionBeanList.add(getItemByEume(Constants.TypeGroup.SYSTEM, Constants.ActionEnum.System_goto_wifi));
        this.mItemActionBeanList.add(getItemByEume(Constants.TypeGroup.SYSTEM, Constants.ActionEnum.System_goto_app));
        this.mItemActionBeanList.add(getItemByEume(Constants.TypeGroup.SYSTEM, Constants.ActionEnum.System_goto_as));
        this.mItemActionBeanList.add(getItemByEume(Constants.TypeGroup.SYSTEM, Constants.ActionEnum.System_goto_fly));
        this.mItemActionBeanList.add(getItemByEume(Constants.TypeGroup.SYSTEM, Constants.ActionEnum.System_goto_dev));
        ObjAdapter objAdapter = new ObjAdapter(this.mItemActionBeanList);
        this.mObjAdapter = objAdapter;
        this.mIdListview.setAdapter((ListAdapter) objAdapter);
    }

    private void showKuai(Constants.TypeGroup typeGroup) {
        this.mTypeGroupChose = typeGroup;
        ArrayList arrayList = new ArrayList();
        this.mItemActionBeanList = arrayList;
        arrayList.add(getItemByEume(Constants.TypeGroup.VIEW, Constants.ActionEnum.VIEW_ALL));
        this.mItemActionBeanList.add(getItemByEume(Constants.TypeGroup.TOOL, Constants.ActionEnum.Tool_wx_sao));
        this.mItemActionBeanList.add(getItemByEume(Constants.TypeGroup.TOOL, Constants.ActionEnum.Tool_wx_fu));
        this.mItemActionBeanList.add(getItemByEume(Constants.TypeGroup.TOOL, Constants.ActionEnum.Tool_wx_xiao));
        this.mItemActionBeanList.add(getItemByEume(Constants.TypeGroup.TOOL, Constants.ActionEnum.Tool_zfb_sao));
        this.mItemActionBeanList.add(getItemByEume(Constants.TypeGroup.TOOL, Constants.ActionEnum.Tool_zfb_shou));
        this.mItemActionBeanList.add(getItemByEume(Constants.TypeGroup.TOOL, Constants.ActionEnum.Tool_zfb_fu));
        this.mItemActionBeanList.add(getItemByEume(Constants.TypeGroup.TOOL, Constants.ActionEnum.Tool_zxing));
        this.mItemActionBeanList.add(getItemByEume(Constants.TypeGroup.TOOL, Constants.ActionEnum.Tool_qq));
        this.mItemActionBeanList.add(getItemByEume(Constants.TypeGroup.TOOL, Constants.ActionEnum.Tool_email));
        this.mItemActionBeanList.add(getItemByEume(Constants.TypeGroup.TOOL, Constants.ActionEnum.Tool_web));
        this.mItemActionBeanList.add(getItemByEume(Constants.TypeGroup.TOOL, Constants.ActionEnum.Tool_url_scheme));
        this.mItemActionBeanList.add(getItemByEume(Constants.TypeGroup.TOOL, Constants.ActionEnum.Tool_shortcut));
        this.mItemActionBeanList.add(getItemByEume(Constants.TypeGroup.TOOL, Constants.ActionEnum.Tool_fulll_text));
        this.mItemActionBeanList.add(getItemByEume(Constants.TypeGroup.TOOL, Constants.ActionEnum.Tool_rect_text));
        this.mItemActionBeanList.add(getItemByEume(Constants.TypeGroup.TOOL, Constants.ActionEnum.Tool_call));
        this.mItemActionBeanList.add(getItemByEume(Constants.TypeGroup.TOOL, Constants.ActionEnum.Tool_msg));
        this.mItemActionBeanList.add(getItemByEume(Constants.TypeGroup.TOOL, Constants.ActionEnum.Tool_media_play));
        this.mItemActionBeanList.add(getItemByEume(Constants.TypeGroup.TOOL, Constants.ActionEnum.Tool_media_pause));
        this.mItemActionBeanList.add(getItemByEume(Constants.TypeGroup.TOOL, Constants.ActionEnum.Tool_media_pre));
        this.mItemActionBeanList.add(getItemByEume(Constants.TypeGroup.TOOL, Constants.ActionEnum.Tool_media_next));
        this.mItemActionBeanList.add(getItemByEume(Constants.TypeGroup.TOOL, Constants.ActionEnum.Tool_media_volume_up));
        this.mItemActionBeanList.add(getItemByEume(Constants.TypeGroup.TOOL, Constants.ActionEnum.Tool_media_volume_down));
        ObjAdapter objAdapter = new ObjAdapter(this.mItemActionBeanList);
        this.mObjAdapter = objAdapter;
        this.mIdListview.setAdapter((ListAdapter) objAdapter);
    }

    private void showControl(Constants.TypeGroup typeGroup) {
        this.mTypeGroupChose = typeGroup;
        ArrayList arrayList = new ArrayList();
        this.mItemActionBeanList = arrayList;
        arrayList.add(new ItemActionBean(Constants.TypeGroup.OTHER, Constants.ActionEnum.Other_list.getType(), null, R.drawable.list01, Constants.ActionEnum.Other_list.getName(), "", true));
        this.mItemActionBeanList.add(new ItemActionBean(Constants.TypeGroup.OTHER, Constants.ActionEnum.Other_stop.getType(), null, R.drawable.auto_stop, Constants.ActionEnum.Other_stop.getName(), "", true));
        this.mItemActionBeanList.add(new ItemActionBean(Constants.TypeGroup.OTHER, Constants.ActionEnum.Other_pause.getType(), null, R.drawable.auto_pause, Constants.ActionEnum.Other_pause.getName(), "", true));
        this.mItemActionBeanList.add(new ItemActionBean(Constants.TypeGroup.OTHER, Constants.ActionEnum.Other_reusm.getType(), null, R.drawable.auto_resume, Constants.ActionEnum.Other_reusm.getName(), "", true));
        ObjAdapter objAdapter = new ObjAdapter(this.mItemActionBeanList);
        this.mObjAdapter = objAdapter;
        this.mIdListview.setAdapter((ListAdapter) objAdapter);
    }

    private void showUserDefinde(Constants.TypeGroup typeGroup) {
        this.mTypeGroupChose = typeGroup;
        this.mItemActionBeanList = new ArrayList();
        List<AutoBean> searchAll = AutoBeanSqlUtil.getInstance().searchAll();
        if (searchAll.size() > 0) {
            for (AutoBean autoBean : searchAll) {
                this.mItemActionBeanList.add(new ItemActionBean(Constants.TypeGroup.AUTO, Constants.ACTION_TYPE_DO_INSIGN_AUTO, null, R.drawable.play_auto_blue, autoBean.getAutoName(), autoBean.getAutoID(), true));
            }
        }
        ObjAdapter objAdapter = new ObjAdapter(this.mItemActionBeanList);
        this.mObjAdapter = objAdapter;
        this.mIdListview.setAdapter((ListAdapter) objAdapter);
    }

    @Override // android.support.v4.app.Fragment
    public void onDestroyView() {
        super.onDestroyView();
    }

    public void onClick(View view) {
        if (view.getId() == R.id.id_add_bt) {
            AutoUtils.gotAddActionActivity(mContext, "", "", "");
        }
    }

    /* access modifiers changed from: private */
    public class ObjAdapter extends BaseAdapter {
        private List<ItemActionBean> mAppInfoList;

        public Object getItem(int i) {
            return null;
        }

        public long getItemId(int i) {
            return 0;
        }

        public ObjAdapter(List<ItemActionBean> list) {
            this.mAppInfoList = list;
        }

        public int getCount() {
            List<ItemActionBean> list = this.mAppInfoList;
            if (list == null) {
                return 0;
            }
            return list.size();
        }

        public View getView(int i, View view, ViewGroup viewGroup) {
            View inflate = View.inflate(FloatFragmentDetail.mContext, R.layout.item_chose, null);
            ImageView imageView = (ImageView) inflate.findViewById(R.id.id_img);
            ImageView imageView2 = (ImageView) inflate.findViewById(R.id.id_img_app);
            ImageView imageView3 = (ImageView) inflate.findViewById(R.id.id_checked);
            ImageView imageView4 = (ImageView) inflate.findViewById(R.id.id_unchecked);
            TextView textView = (TextView) inflate.findViewById(R.id.id_name);
            final ItemActionBean itemActionBean = this.mAppInfoList.get(i);
            final String actionType = itemActionBean.getActionType();
            if (FloatFragmentDetail.this.mState == 3) {
                imageView.setVisibility(View.GONE);
                imageView2.setVisibility(View.VISIBLE);
                imageView2.setImageDrawable(itemActionBean.getAppIcon());
            } else {
                imageView.setVisibility(View.VISIBLE);
                imageView2.setVisibility(View.GONE);
                try {
                    Glide.with(FloatFragmentDetail.mContext).load(Integer.valueOf(itemActionBean.getActionImg())).into(imageView);
                } catch (Exception e) {
                    e.printStackTrace();
                }
            }
            String actionName = itemActionBean.getActionName();
            if (TextUtils.isEmpty(FloatFragmentDetail.this.mSearchName)) {
                textView.setText(actionName);
            } else {
                String str = FloatFragmentDetail.this.mSearchName;
                textView.setText(Html.fromHtml(actionName.replace(str, "<font color='#FF0000'>" + FloatFragmentDetail.this.mSearchName + "</font>")));
            }
            if (TextUtils.isEmpty(FloatFragmentDetail.this.mDirectData)) {
                imageView3.setVisibility(View.GONE);
                imageView4.setVisibility(View.VISIBLE);
            } else if (!actionType.equals(FloatFragmentDetail.this.mActionBean.getActionType())) {
                imageView3.setVisibility(View.GONE);
                imageView4.setVisibility(View.VISIBLE);
            } else if (actionType.equals(Constants.ACTION_TYPE_OPEN_APP_NEW)) {
                if (FloatFragmentDetail.this.mDetailBean == null) {
                    imageView3.setVisibility(View.GONE);
                    imageView4.setVisibility(View.VISIBLE);
                } else if (itemActionBean.getActionDetail().equals(FloatFragmentDetail.this.mDetailBean.getPackName())) {
                    imageView3.setVisibility(View.VISIBLE);
                    imageView4.setVisibility(View.GONE);
                } else {
                    imageView3.setVisibility(View.GONE);
                    imageView4.setVisibility(View.VISIBLE);
                }
            } else if (!actionType.equals(Constants.ACTION_TYPE_DO_INSIGN_AUTO)) {
                imageView3.setVisibility(View.VISIBLE);
                imageView4.setVisibility(View.GONE);
            } else if (FloatFragmentDetail.this.mDetailBean == null) {
                imageView3.setVisibility(View.GONE);
                imageView4.setVisibility(View.VISIBLE);
            } else {
                String actionDetail = itemActionBean.getActionDetail();
                if (actionDetail == null) {
                    imageView3.setVisibility(View.GONE);
                    imageView4.setVisibility(View.VISIBLE);
                } else if (actionDetail.equals(FloatFragmentDetail.this.mDetailBean.getAutoID())) {
                    imageView3.setVisibility(View.VISIBLE);
                    imageView4.setVisibility(View.GONE);
                } else {
                    imageView3.setVisibility(View.GONE);
                    imageView4.setVisibility(View.VISIBLE);
                }
            }
            inflate.setOnClickListener(new View.OnClickListener() {
                /* class com.lmiot.xyclick.Bind.FloatFragmentDetail.ObjAdapter.AnonymousClass1 */

                public void onClick(View view) {
                    if (TextUtils.isEmpty(FloatFragmentDetail.this.mDirectData)) {
                        ObjAdapter.this.setData(itemActionBean);
                    } else if (!actionType.equals(FloatFragmentDetail.this.mActionBean.getActionType())) {
                        ObjAdapter.this.setData(itemActionBean);
                    } else if (actionType.equals(Constants.ACTION_TYPE_OPEN_APP_NEW)) {
                        if (FloatFragmentDetail.this.mDetailBean == null) {
                            ObjAdapter.this.setData(itemActionBean);
                        } else if (itemActionBean.getActionDetail().equals(FloatFragmentDetail.this.mDetailBean.getPackName())) {
                            ObjAdapter.this.clearSetData();
                        } else {
                            ObjAdapter.this.setData(itemActionBean);
                        }
                    } else if (!actionType.equals(Constants.ACTION_TYPE_DO_INSIGN_AUTO)) {
                        ObjAdapter.this.clearSetData();
                    } else if (FloatFragmentDetail.this.mDetailBean == null) {
                        ObjAdapter.this.setData(itemActionBean);
                    } else if (itemActionBean.getActionDetail().equals(FloatFragmentDetail.this.mDetailBean.getAutoID())) {
                        ObjAdapter.this.clearSetData();
                    } else {
                        ObjAdapter.this.setData(itemActionBean);
                    }
                }
            });
            return inflate;
        }

        /* access modifiers changed from: private */
        /* JADX INFO: Can't fix incorrect switch cases order, some code will duplicate */
        /* access modifiers changed from: public */
        /* JADX WARNING: Code restructure failed: missing block: B:31:0x009e, code lost:
            if (r4.equals(com.lmiot.xyclick.Util.Constants.ACTION_TYPE_OPEN_APP_NEW) == false) goto L_0x002d;
         */
        /* Code decompiled incorrectly, please refer to instructions dump. */
        private void setData(ItemActionBean r21) {
            /*
            // Method dump skipped, instructions count: 508
            */
            throw new UnsupportedOperationException("Method not decompiled: com.lmiot.xyclick.Bind.FloatFragmentDetail.ObjAdapter.setData(com.lmiot.xyclick.Bean.ItemActionBean):void");
        }

        /* access modifiers changed from: private */
        /* access modifiers changed from: public */
        private void clearSetData() {
            DataUtil.setDirectData(FloatFragmentDetail.mContext, FloatFragmentDetail.this.mDirect, "");
            notifyDataSetChanged();
            ((Activity) FloatFragmentDetail.mContext).finish();
        }

        /* access modifiers changed from: private */
        /* access modifiers changed from: public */
        private void setData(ActionBean actionBean, DetailBean detailBean) {
            actionBean.setDetail(new Gson().toJson(detailBean));
            DataUtil.setDirectData(FloatFragmentDetail.mContext, FloatFragmentDetail.this.mDirect, new Gson().toJson(actionBean));
            notifyDataSetChanged();
            ((Activity) FloatFragmentDetail.mContext).finish();
        }

        public void setData(List<ItemActionBean> list, String str) {
            this.mAppInfoList = list;
            FloatFragmentDetail.this.mSearchName = str;
            notifyDataSetChanged();
        }
    }

    private void setFind() {
        this.mIdSearchEdit.addTextChangedListener(new TextWatcher() {
            /* class com.lmiot.xyclick.Bind.FloatFragmentDetail.AnonymousClass3 */

            public void afterTextChanged(Editable editable) {
            }

            public void beforeTextChanged(CharSequence charSequence, int i, int i2, int i3) {
            }

            public void onTextChanged(CharSequence charSequence, int i, int i2, int i3) {
                FloatFragmentDetail.this.mSearchName = charSequence.toString();
                if (!TextUtils.isEmpty(FloatFragmentDetail.this.mSearchName)) {
                    ArrayList arrayList = new ArrayList();
                    if (FloatFragmentDetail.this.mItemActionBeanList != null && FloatFragmentDetail.this.mItemActionBeanList.size() > 0) {
                        for (ItemActionBean itemActionBean : FloatFragmentDetail.this.mItemActionBeanList) {
                            if (itemActionBean.getActionName().contains(FloatFragmentDetail.this.mSearchName)) {
                                arrayList.add(itemActionBean);
                            }
                        }
                        if (FloatFragmentDetail.this.mObjAdapter != null) {
                            FloatFragmentDetail.this.mObjAdapter.setData(arrayList, FloatFragmentDetail.this.mSearchName);
                        }
                    }
                } else if (FloatFragmentDetail.this.mObjAdapter != null) {
                    FloatFragmentDetail.this.mObjAdapter.setData(FloatFragmentDetail.this.mItemActionBeanList, (String) null);
                }
            }
        });
    }

    public ItemActionBean getItemByEume(Constants.TypeGroup typeGroup, Constants.ActionEnum actionEnum) {
        return new ItemActionBean(typeGroup, actionEnum.getType(), null, actionEnum.getImg(), actionEnum.getName(), actionEnum.getDetail(), actionEnum.isVip());
    }
}
